package org.admanager.acmeadmapping.plugin.diagram.navigator;

import org.admanager.acmeadmanagement.plugin.acmeadmanagement.PComponentPort;
import org.admanager.acmeadmanagement.plugin.acmeadmanagement.PConnectorRole;
import org.admanager.acmeadmanagement.plugin.acmeadmanagement.PMultiplicity;
import org.admanager.acmeadmanagement.plugin.acmeadmanagement.Port;
import org.admanager.acmeadmanagement.plugin.acmeadmanagement.Role;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.AttachmentEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.BindingEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.CBAPatternEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.CBAPatternNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentMappingEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentMappingSourceEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentMappingTargetEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentPortMappingEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentPortMappingSourceEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ComponentPortMappingTargetEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorMappingEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorMappingSourceEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorMappingTargetEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorRoleMappingEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorRoleMappingSourceEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.ConnectorRoleMappingTargetEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.MappingRootEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponent2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponentEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponentName2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponentNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponentPort2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PComponentPortEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnector2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnectorEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnectorName2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnectorNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnectorRole2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConnectorRoleEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConstraintEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PConstraintNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PMultiplicityEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PRoleEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PRoleNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.PortEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.RepresentationEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.RepresentationNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.RoleEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.System2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.SystemEditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.SystemName2EditPart;
import org.admanager.acmeadmapping.plugin.diagram.edit.parts.SystemNameEditPart;
import org.admanager.acmeadmapping.plugin.diagram.part.AcmeADManagementMetamodelDiagramEditorPlugin;
import org.admanager.acmeadmapping.plugin.diagram.part.AcmeADManagementMetamodelVisualIDRegistry;
import org.admanager.acmeadmapping.plugin.diagram.providers.AcmeADManagementMetamodelElementTypes;
import org.admanager.acmeadmapping.plugin.diagram.providers.AcmeADManagementMetamodelParserProvider;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

/**
 * @generated
 */
public class AcmeADManagementMetamodelNavigatorLabelProvider extends
		LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		AcmeADManagementMetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		AcmeADManagementMetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof AcmeADManagementMetamodelNavigatorItem
				&& !isOwnView(((AcmeADManagementMetamodelNavigatorItem) element)
						.getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof AcmeADManagementMetamodelNavigatorGroup) {
			AcmeADManagementMetamodelNavigatorGroup group = (AcmeADManagementMetamodelNavigatorGroup) element;
			return AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.getBundledImage(group.getIcon());
		}

		if (element instanceof AcmeADManagementMetamodelNavigatorItem) {
			AcmeADManagementMetamodelNavigatorItem navigatorItem = (AcmeADManagementMetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getImage(view);
			}
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (AcmeADManagementMetamodelVisualIDRegistry.getVisualID(view)) {
		case PMultiplicityEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PMultiplicity", AcmeADManagementMetamodelElementTypes.PMultiplicity_3020); //$NON-NLS-1$
		case ComponentMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?ComponentMapping", AcmeADManagementMetamodelElementTypes.ComponentMapping_2027); //$NON-NLS-1$
		case ConnectorRoleMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ConnectorRoleMapping?source", AcmeADManagementMetamodelElementTypes.ConnectorRoleMappingSource_4035); //$NON-NLS-1$
		case ComponentPortMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ComponentPortMapping?target", AcmeADManagementMetamodelElementTypes.ComponentPortMappingTarget_4039); //$NON-NLS-1$
		case ConnectorMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ConnectorMapping?source", AcmeADManagementMetamodelElementTypes.ConnectorMappingSource_4034); //$NON-NLS-1$
		case ComponentPortMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?ComponentPortMapping", AcmeADManagementMetamodelElementTypes.ComponentPortMapping_2024); //$NON-NLS-1$
		case ConnectorEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?Connector", AcmeADManagementMetamodelElementTypes.Connector_3035); //$NON-NLS-1$
		case PConnectorRole2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PConnectorRole", AcmeADManagementMetamodelElementTypes.PConnectorRole_3029); //$NON-NLS-1$
		case PRoleEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PRole", AcmeADManagementMetamodelElementTypes.PRole_3021); //$NON-NLS-1$
		case MappingRootEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://acmeadmanagement/1.0?MappingRoot", AcmeADManagementMetamodelElementTypes.MappingRoot_1000); //$NON-NLS-1$
		case AttachmentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?Attachment", AcmeADManagementMetamodelElementTypes.Attachment_4041); //$NON-NLS-1$
		case PComponentPort2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PComponentPort", AcmeADManagementMetamodelElementTypes.PComponentPort_3027); //$NON-NLS-1$
		case ComponentPortMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ComponentPortMapping?source", AcmeADManagementMetamodelElementTypes.ComponentPortMappingSource_4037); //$NON-NLS-1$
		case PComponent2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PComponent", AcmeADManagementMetamodelElementTypes.PComponent_3026); //$NON-NLS-1$
		case CBAPatternEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?CBAPattern", AcmeADManagementMetamodelElementTypes.CBAPattern_2028); //$NON-NLS-1$
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ComponentMapping?target", AcmeADManagementMetamodelElementTypes.ComponentMappingTarget_4038); //$NON-NLS-1$
		case PortEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?Port", AcmeADManagementMetamodelElementTypes.Port_3032); //$NON-NLS-1$
		case ConnectorMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?ConnectorMapping", AcmeADManagementMetamodelElementTypes.ConnectorMapping_2026); //$NON-NLS-1$
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ComponentMapping?source", AcmeADManagementMetamodelElementTypes.ComponentMappingSource_4036); //$NON-NLS-1$
		case ConnectorMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ConnectorMapping?target", AcmeADManagementMetamodelElementTypes.ConnectorMappingTarget_4033); //$NON-NLS-1$
		case SystemEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?System", AcmeADManagementMetamodelElementTypes.System_2029); //$NON-NLS-1$
		case ComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?Component", AcmeADManagementMetamodelElementTypes.Component_3031); //$NON-NLS-1$
		case RepresentationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?Representation", AcmeADManagementMetamodelElementTypes.Representation_3033); //$NON-NLS-1$
		case PConnectorEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PConnector", AcmeADManagementMetamodelElementTypes.PConnector_3028); //$NON-NLS-1$
		case RoleEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?Role", AcmeADManagementMetamodelElementTypes.Role_3036); //$NON-NLS-1$
		case PComponentPortEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PComponentPort", AcmeADManagementMetamodelElementTypes.PComponentPort_3023); //$NON-NLS-1$
		case BindingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?Binding", AcmeADManagementMetamodelElementTypes.Binding_4042); //$NON-NLS-1$
		case PConstraintEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PConstraint", AcmeADManagementMetamodelElementTypes.PConstraint_3022); //$NON-NLS-1$
		case System2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?System", AcmeADManagementMetamodelElementTypes.System_3034); //$NON-NLS-1$
		case PComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PComponent", AcmeADManagementMetamodelElementTypes.PComponent_3025); //$NON-NLS-1$
		case PConnector2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PConnector", AcmeADManagementMetamodelElementTypes.PConnector_3030); //$NON-NLS-1$
		case ConnectorRoleMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://acmeadmanagement/1.0?ConnectorRoleMapping", AcmeADManagementMetamodelElementTypes.ConnectorRoleMapping_2025); //$NON-NLS-1$
		case ConnectorRoleMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://acmeadmanagement/1.0?ConnectorRoleMapping?target", AcmeADManagementMetamodelElementTypes.ConnectorRoleMappingTarget_4040); //$NON-NLS-1$
		case PConnectorRoleEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://acmeadmanagement/1.0?PConnectorRole", AcmeADManagementMetamodelElementTypes.PConnectorRole_3024); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = AcmeADManagementMetamodelDiagramEditorPlugin
				.getInstance().getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null
				&& elementType != null
				&& AcmeADManagementMetamodelElementTypes
						.isKnownElementType(elementType)) {
			image = AcmeADManagementMetamodelElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof AcmeADManagementMetamodelNavigatorGroup) {
			AcmeADManagementMetamodelNavigatorGroup group = (AcmeADManagementMetamodelNavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof AcmeADManagementMetamodelNavigatorItem) {
			AcmeADManagementMetamodelNavigatorItem navigatorItem = (AcmeADManagementMetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getText(view);
			}
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (AcmeADManagementMetamodelVisualIDRegistry.getVisualID(view)) {
		case PMultiplicityEditPart.VISUAL_ID:
			return getPMultiplicity_3020Text(view);
		case ComponentMappingEditPart.VISUAL_ID:
			return getComponentMapping_2027Text(view);
		case ConnectorRoleMappingSourceEditPart.VISUAL_ID:
			return getConnectorRoleMappingSource_4035Text(view);
		case ComponentPortMappingTargetEditPart.VISUAL_ID:
			return getComponentPortMappingTarget_4039Text(view);
		case ConnectorMappingSourceEditPart.VISUAL_ID:
			return getConnectorMappingSource_4034Text(view);
		case ComponentPortMappingEditPart.VISUAL_ID:
			return getComponentPortMapping_2024Text(view);
		case ConnectorEditPart.VISUAL_ID:
			return getConnector_3035Text(view);
		case PConnectorRole2EditPart.VISUAL_ID:
			return getPConnectorRole_3029Text(view);
		case PRoleEditPart.VISUAL_ID:
			return getPRole_3021Text(view);
		case MappingRootEditPart.VISUAL_ID:
			return getMappingRoot_1000Text(view);
		case AttachmentEditPart.VISUAL_ID:
			return getAttachment_4041Text(view);
		case PComponentPort2EditPart.VISUAL_ID:
			return getPComponentPort_3027Text(view);
		case ComponentPortMappingSourceEditPart.VISUAL_ID:
			return getComponentPortMappingSource_4037Text(view);
		case PComponent2EditPart.VISUAL_ID:
			return getPComponent_3026Text(view);
		case CBAPatternEditPart.VISUAL_ID:
			return getCBAPattern_2028Text(view);
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getComponentMappingTarget_4038Text(view);
		case PortEditPart.VISUAL_ID:
			return getPort_3032Text(view);
		case ConnectorMappingEditPart.VISUAL_ID:
			return getConnectorMapping_2026Text(view);
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getComponentMappingSource_4036Text(view);
		case ConnectorMappingTargetEditPart.VISUAL_ID:
			return getConnectorMappingTarget_4033Text(view);
		case SystemEditPart.VISUAL_ID:
			return getSystem_2029Text(view);
		case ComponentEditPart.VISUAL_ID:
			return getComponent_3031Text(view);
		case RepresentationEditPart.VISUAL_ID:
			return getRepresentation_3033Text(view);
		case PConnectorEditPart.VISUAL_ID:
			return getPConnector_3028Text(view);
		case RoleEditPart.VISUAL_ID:
			return getRole_3036Text(view);
		case PComponentPortEditPart.VISUAL_ID:
			return getPComponentPort_3023Text(view);
		case BindingEditPart.VISUAL_ID:
			return getBinding_4042Text(view);
		case PConstraintEditPart.VISUAL_ID:
			return getPConstraint_3022Text(view);
		case System2EditPart.VISUAL_ID:
			return getSystem_3034Text(view);
		case PComponentEditPart.VISUAL_ID:
			return getPComponent_3025Text(view);
		case PConnector2EditPart.VISUAL_ID:
			return getPConnector_3030Text(view);
		case ConnectorRoleMappingEditPart.VISUAL_ID:
			return getConnectorRoleMapping_2025Text(view);
		case ConnectorRoleMappingTargetEditPart.VISUAL_ID:
			return getConnectorRoleMappingTarget_4040Text(view);
		case PConnectorRoleEditPart.VISUAL_ID:
			return getPConnectorRole_3024Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getConnector_3035Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.Connector_3035, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(ConnectorNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5020); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getConnectorRoleMappingSource_4035Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getConnectorMappingSource_4034Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentPortMappingSource_4037Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getConnectorRoleMappingTarget_4040Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPConnectorRole_3029Text(View view) {
		PConnectorRole domainModelElement = (PConnectorRole) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3029); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentMappingSource_4036Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getConnectorRoleMapping_2025Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComponent_3026Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PComponent_3026, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PComponentName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5016); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getSystem_2029Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.System_2029, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(SystemNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5024); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentPortMapping_2024Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getRole_3036Text(View view) {
		Role domainModelElement = (Role) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3036); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getBinding_4042Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMapping_2027Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getRepresentation_3033Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.Representation_3033, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(RepresentationNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5022); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPConnectorRole_3024Text(View view) {
		PConnectorRole domainModelElement = (PConnectorRole) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3024); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getCBAPattern_2028Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.CBAPattern_2028, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(CBAPatternNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5019); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentPortMappingTarget_4039Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getConnectorMappingTarget_4033Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getMappingRoot_1000Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPRole_3021Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PRole_3021, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PRoleNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5014); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getConnectorMapping_2026Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getSystem_3034Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.System_3034, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(SystemName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5021); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPConstraint_3022Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PConstraint_3022, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PConstraintNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponent_3031Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.Component_3031, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(ComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPort_3032Text(View view) {
		Port domainModelElement = (Port) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3032); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPComponentPort_3023Text(View view) {
		PComponentPort domainModelElement = (PComponentPort) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentMappingTarget_4038Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPConnector_3030Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PConnector_3030, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PConnectorName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getAttachment_4041Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComponentPort_3027Text(View view) {
		PComponentPort domainModelElement = (PComponentPort) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3027); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPComponent_3025Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PComponent_3025, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5017); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPMultiplicity_3020Text(View view) {
		PMultiplicity domainModelElement = (PMultiplicity) view.getElement();
		if (domainModelElement != null) {
			return String.valueOf(domainModelElement.getLowerBound());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin
					.getInstance()
					.logError(
							"No domain element for view with visualID = " + 3020); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPConnector_3028Text(View view) {
		IParser parser = AcmeADManagementMetamodelParserProvider.getParser(
				AcmeADManagementMetamodelElementTypes.PConnector_3028, view
						.getElement() != null ? view.getElement() : view,
				AcmeADManagementMetamodelVisualIDRegistry
						.getType(PConnectorNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			AcmeADManagementMetamodelDiagramEditorPlugin.getInstance()
					.logError("Parser was not found for label " + 5015); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return MappingRootEditPart.MODEL_ID
				.equals(AcmeADManagementMetamodelVisualIDRegistry
						.getModelID(view));
	}

}
